package cn.com.nes.common.em.platform;

import cn.com.nes.site.config.CustomConfigurationProperties;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public enum OpeMethodEnum {

    sendCommand("发送控制指令", "/protocolTest/sendCommand"),
    sendControlCommandNoEncryption("发送控制指令不加密", "/protocolTest/sendControlCommandNoEncryption"),
    getCardInfo("获取卡信息",  "/dtu/getCardInfo"),
    testQueryCommand("测试查询指令",  "/protocolTest/testQueryCommand"),
    RESTART_DTU("离线DTU",  "/protocolTest/restartDtu"),
    RELOAD_PROTOCOL_INFO("重新加载协议信息",  "/protocol/reloadProtocolInfoNoAuthCheck"),

    ;

    private static String URL = CustomConfigurationProperties.getOpeUrl() + "/" + PlatformEnum._ope.getServerContext();

    private String remark;

    private String method;

    OpeMethodEnum(String remark, String method) {
        this.remark = remark;
        this.method = method;
    }

    public String getRemark() {
        return remark;
    }

    public String url() {
        log.info("{}", URL + method);
        return URL + method;
    }

}
